function plot(self,fig,type,val)
%*=+--+=#=+--      UAS Severe Weather Simulation Softeware        --+=#=+--+=#*%
%          Copyright (C) 2013 Regents of the University of Colorado.           %
%                             All Rights Reserved.                             %
%                                                                              %
%    This program is free software: you can redistribute it and/or modify      %
%    it under the terms of the GNU General Public License version 2 as         %
%    published by the Free Software Foundation.                                %
%                                                                              %
%    This program is distributed in the hope that it will be useful,           %
%    but WITHOUT ANY WARRANTY; without even the implied warranty of            %
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             %
%    GNU General Public License for more details.                              %
%                                                                              %
%    You should have received a copy of the GNU General Public License         %
%    along with this program.  If not, see <http://www.gnu.org/licenses/>.     %
%                                                                              %
%           Jack Elston                                                        %
%           elstonj@colorado.edu                                               %
%                                                                              %
%*=+--+=#=+--                 --+=#=+--+=#=+--                    --+=#=+--+=#*%

  figure(fig);

  if nargin == 2
    unit = 3*10^2;

    rotation_matrix = [cos(-self.euler(3)) -sin(-self.euler(3));
                       sin(-self.euler(3))  cos(-self.euler(3))];

											 %-----[ Velocity ]-----%
%    ua_wing = [0 5 5 0 -5 -5 0;
%               1 -1 -3 -2 -3 -1 1];
%    ua_elev = [-3 3 3 -3;
%               2 2 1 1];
%    ua_fuse = [0 1 1 0 -1 -1 0;
%               4 0 -2 -3 -2 0 4];

											 %-----[ Tempest ]-----%

    ua_wing = [0 -8 -9  9 8 0;
							 1  0 -1 -1 0 1];
    ua_elev = [0  -2 -2  2  2  0;
							 -4 -5 -6 -6 -5 -4];
    ua_fuse = [0 -1  0 1 0;
							 4  1 -6 1 4];
               

    ua_wing=rotation_matrix*ua_wing.*unit;
    ua_elev=rotation_matrix*ua_elev.*unit;
    ua_fuse=rotation_matrix*ua_fuse.*unit;

    hold on;
    h = patch(ua_wing(1,:)+self.pos(1),ua_wing(2,:)+self.pos(2),'w');
		set(h,'FaceColor',[0 0 0]);
    h = patch(ua_elev(1,:)+self.pos(1),ua_elev(2,:)+self.pos(2),'w');
		set(h,'FaceColor',[0 0 0]);
    h = patch(ua_fuse(1,:)+self.pos(1),ua_fuse(2,:)+self.pos(2),'w');
		set(h,'FaceColor',[0 0 0]);
  else
    switch type
      case 'alt'
        plot(self.log.position(:,3));
        title('Altitude (m)');
      case 'control'
        switch val
          case 1
            plot(self.log.input(:,1));
            %axis([time-30 time+30 self.vmin-5 self.vmax+5]);
            title('Commanded Velocity (m/s)');
          case 2
            plot(self.log.input(:,2));
            %axis([time-30 time+30 -self.turnmax-0.1 self.turnmax+0.1]);
            title('Commanded Turn Rate (rad/s)');
        end
      case 'track'
        plot(self.log.position(2:end,1),self.log.position(2:end,2),'r','LineWidth',3);
      case 'error'
        plot(self.log.err(1:end));
        title('Position Error Magnitude (m)');
    end
  end
